import React from "react"

export default class ZUJIAN extends  React.Component{

    constructor(props) {
        super(props)
        this.state = {
            count:10
        }
    }


    componentWillMount(){
        
    }
    componentDidMount(){

    }
    shouldComponentUpdate(){
        return true
    }
    componentDidUpdate(){

    }
    componentWillReceiveProps(){

    }
    componentWillUnmount(){

    }

    async increment(){
        await this.setStateAsync({count:this.state.count+1})
        console.log(this.state.count)
    }

    setStateAsync(state) {
        return new Promise((resolve)=>{
            this.setState(state,resolve)
        })
    }



    render(){
        return (
            <div>
                <p>{this.state.count}</p>
                <button onClick={this.increment.bind(this)}></button>
            </div>
        )
    }

}